#!/usr/bin/python
# vim:ts=4:sw=4:softtabstop=0:smarttab

include("database.conf")
include("icons.conf")

### web interface

USERNAME = "lighttpd"

ADMINS = [
    ('me@mycompany.biz', 'My Name'),
]

#MIDDLEWARE = [("firepython.middleware.FirePythonWSGI",)]
MIDDLEWARE = []

# Map pattern to handler functions. 
LOCATIONMAP = (
  (r"^/api/(?P<methodname>\w+)$", "pycopia.db.webservice.dispatcher"),
  (r"^/db/?$", "pycopia.db.webservice.main"), # XXX main entry point may change
# Basic, generic table editor
  (r"^/?$", "pycopia.db.webservice.listall"),
  (r"^/table/$", "pycopia.db.webservice.listall"),
  (r"^/table/(?P<tablename>\w+)/$", "pycopia.db.webservice.listtable"),
  (r"^/table/(?P<tablename>\w+)/addentry/$", "pycopia.db.webservice.addentry"),
  (r"^/table/(?P<tablename>\w+)/view/$", "pycopia.WWW.framework.redirectup"),
  (r"^/table/(?P<tablename>\w+)/view/(?P<rowid>\d+)/?$", "pycopia.db.webservice.view"),
  (r"^/table/(?P<tablename>\w+)/edit/$", "pycopia.WWW.framework.redirectup"),
  (r"^/table/(?P<tablename>\w+)/edit/(?P<rowid>\d+)/$", "pycopia.db.webservice.edit"),
# user config editor
  (r"^/config/?$", "pycopia.db.webui.confedit.config_main"),
  (r"^/config/update/?$", "pycopia.db.webui.confedit.config_update"),
# countryset editor
  (r"^/countryset/?$", "pycopia.db.webui.countryset.main"),
    # aliases don't have a dot in the name.
  (r'/media/css/(?P<name>\S+)', "css"),
  (r'/media/js/(?P<name>\S+)', "js"),
  (r'/media/images/(?P<name>\S+)', "images"),
)


